package cn.com.shopec.erp.system.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @ClassName PageElement
 * @Description 页面元素表实体
 * @author chengui
 * @date 2013-5-29 下午5:01:12
 */
@Entity
@Table(name = "tbl_scm_page_element")
public class PageElement implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3245250329750907671L;
	
	/** 主键. */
	private String id;
	/** 页面元素名称. */
	private String pageElementName;
	/** 页面元素代码. */
	private String pageElementCode;
	/** 删除标识:0-已删除，1-未删除. */
	private int deleteFlag = 1;
	
	/** 权限. */
	private Access access;

	public PageElement() {
		super();
	}
	public PageElement(String id) {
		super();
		this.id = id;
	}
	public PageElement(String id, String pageElementName,
			String pageElementCode, int deleteFlag) {
		super();
		this.id = id;
		this.pageElementName = pageElementName;
		this.pageElementCode = pageElementCode;
		this.deleteFlag = deleteFlag;
	}
	
	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}
	public void setId(String id) {
		this.id = id;
	}
	@Column(name = "page_element_name")
	public String getPageElementName() {
		return pageElementName;
	}
	public void setPageElementName(String pageElementName) {
		this.pageElementName = pageElementName;
	}
	@Column(name = "page_element_code")
	public String getPageElementCode() {
		return pageElementCode;
	}
	public void setPageElementCode(String pageElementCode) {
		this.pageElementCode = pageElementCode;
	}
	@Column(name = "delete_flag")
	public int getDeleteFlag() {
		return deleteFlag;
	}
	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "element_access")
	public Access getAccess() {
		return access;
	}
	public void setAccess(Access access) {
		this.access = access;
	}

}
